package com.yeyks.common.convert;

import java.beans.PropertyEditorSupport;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateEditor extends PropertyEditorSupport {

    @Override
    public void setAsText(String text) {
        //SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        try {
            //Date date = dateFormat.parse(text);
            Date date = new Date(Long.valueOf(text));
            setValue(date);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
